package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 账号状态
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum UserAccountStatus implements BaseEnum<Integer> {

    /** 账号状态-禁用 */
    DISABLED(0, "禁用"),
    /** 账号状态-正常 */
    NORMAL(1, "正常"),
    /** 账号状态-锁定 */
    LOCKED(2, "锁定");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static UserAccountStatus getByCode(Integer code) {
        return BaseEnum.getByCode(UserAccountStatus.class, code);
    }

    @JsonCreator
    public static UserAccountStatus getByName(String name) {
        return BaseEnum.getByName(name, UserAccountStatus.class);
    }

}
